<?php
	// setup include path for simpletest
	set_include_path(dirname(__FILE__).'/../'.PATH_SEPARATOR.get_include_path());
	
	// set high error reporting level
	error_reporting(E_ALL);
	
	require_once('simpletest/unit_tester.php');
	require_once('simpletest/reporter.php');
	require_once('simpletest/mock_objects.php');
	
	class EasyRunner {
		public static function isRunner() {
			static $isRunner = true;
			if($isRunner == true) {
				$isRunner = false;
				return true;
			}
			return false;
		}
	
		public static function run($test) {
			if(SimpleReporter::inCli()) {
				exit($test->run(new TextReporter()) ? 0 : 1);
			}
			$test->run(new HtmlReporter());
		}
	}
?>